package model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@SuppressWarnings("serial")
@Embeddable
public class ChiTietHoaDon_SachID implements Serializable{
	private int idHoaDon;
	private int idSach;
	
	
	public ChiTietHoaDon_SachID(int idHoaDon, int idSach) {
		super();
		this.idHoaDon = idHoaDon;
		this.idSach = idSach;
	}
	public ChiTietHoaDon_SachID(){
		
	}
	@Column(name = "ID_HoaDon", nullable = false)
	public int getIdHoaDon() {
		return idHoaDon;
	}

	public void setIdHoaDon(int idHoaDon) {
		this.idHoaDon = idHoaDon;
	}

	@Column(name = "ID_Sach", nullable = false)
	public int getIdSach() {
		return idSach;
	}

	public void setIdSach(int idSach) {
		this.idSach = idSach;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + idSach;
		result = prime * result + idHoaDon;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChiTietHoaDon_SachID other = (ChiTietHoaDon_SachID) obj;
		if (idSach != other.idSach)
			return false;
		if (idHoaDon != other.idHoaDon)
			return false;
		return true;
	}
}
